package com.huai.demo_test1.config;

import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 淮晓欢
 * @date 2021/12/28
 **/
@Configuration
public class HttpClientConfig {

    @Bean
    @ConditionalOnClass(HttpClient.class)
    public HttpClient httpClient(){
        return HttpClients.createDefault();
    }
}
